import sys
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)

from PyQt5.Qt  import *
class Window(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("的窗口学习")
        self.resize(800, 600)
        self.setup_ui()

    def setup_ui(self):
        #self.QObject属性和方法()
        self.QObject属性()
    def QObject属性和方法(self):
        mro=QObject.__mro__
        for cls in mro:
            print(cls)
    def QObject属性(self):
        #*************#*************开始
        # obj = QObject()
        # obj.setObjectName("122")  #设置属性名
        # print(obj.objectName())
        # obj.setProperty("test1", "error")  #设置属性值
        # obj.setProperty("test2", "warning")
        # print(obj.property('test1'))
        # print(obj.dynamicPropertyNames())
        #*************#*************结束

#*************案例演示*************开始
        with open("Object.qss","r") as f:
            qApp.setStyleSheet(f.read())

        label1=QLabel(self)
        label1.setObjectName("notice")  #qss对样式进行限制   属性名为 notice才生效
        label1.setText("我是个文本")
        label1.move(50,50)

        label2 = QLabel(self)
        label2.setText("我是个文本")
        label2.move(50,100)

        label3 = QLabel(self)
        label3.setText("我是个文本")
        label3.move(50,150)


#*************#*************结束





if __name__ == '__main__':
    app = QApplication(sys.argv)
    window = Window()
    window.show()
    sys.exit(app.exec_())